<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 27662
  Date: 2024/9/3
  Time: 15:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理员修改排班</title>
<%--    医生名称+科室 看病人数 周几 --%>
    <script src="../static/js/jquery.min.js"></script>
</head>
<body>
<center>
    <h2>修改排班</h2>
    <font style="color: red">${msg}</font>
    <form action="${pageContext.request.contextPath}/admin/updatePaiBan.do" method="post" id="f1">
       <!--添加三个隐藏域-->
        <input type="hidden" name="id" value="${plan.id}">
        <input type="hidden" name="pageNum" value="${pageNum}">
        <input type="hidden" name="pageSize" value="${pageSize}">
        医生及科室：
        <select name="doctor" id="doctor">

        </select><br/>
        就诊人数：
        <input type="text" name="num1" id="num1" value="${plan.number}"><br/>
        就诊时间：
<%--        <input type="hidden" name="week" id="week">--%>
        <select name="week" id="zhouJi">
<%--            <option ${plan.week=='周一'?'selected=selected':''}>请选择</option>--%>
            <option ${plan.week=='星期一'?'selected=selected':''}>星期一</option>
            <option ${plan.week=='星期二'?'selected=selected':''}>星期二</option>
            <option ${plan.week=='星期三'?'selected=selected':''}>星期三</option>
            <option ${plan.week=='星期四'?'selected=selected':''}>星期四</option>
            <option ${plan.week=='星期五'?'selected=selected':''}>星期五</option>
            <option ${plan.week=='星期六'?'selected=selected':''}>星期六</option>
            <option ${plan.week=='星期日'?'selected=selected':''}>星期日</option>
        </select><br/>
        <input type="submit" value="提交">
    </form>
</center>
</body>
<script>
    var dcid=${plan.doctor_id}
    $(document).ready(function (){
        //查询医生及科室并回显
        $.get("${pageContext.request.contextPath}/doctor/findDoctorsKe.do",function (data){
            // console.log(data)
            for(i=0;i<data.length;i++){
                if (dcid==data[i].id){
                    $("#doctor").append("<option value='"+data[i].id+'-'+data[i].department1.id+"'>"+data[i].name+'-'+data[i].department1.department_name+"</option>")
                }
            }
        })

    })

    $("#zhouJi").change(function (){
        // console.log($("#zhouJi option:selected").text())
        var week1 = $("#zhouJi option:selected").text();
        $("#week").val(week1);
    })
</script>
</html>
